<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
	/**
	 * CodeIgniter
	 *
	 * An open source application development framework for PHP 4.3.2 or newer
	 *
	 * @package		CodeIgniter
	 * @author		ExpressionEngine Dev Team
	 * @copyright	Copyright (c) 2008 - 2009, EllisLab, Inc.
	 * @license		http://codeigniter.com/user_guide/license.html
	 * @link		http://codeigniter.com
	 * @since		Version 1.0
	 * @filesource
	 */
	// ------------------------------------------------------------------------
	
	/**
	 * @package		CodeIgniter
	 * @subpackage	Libraries
	 * @author		AnhDT
	 */
	require_once APP_LIBRARY_PATH . 'tree/menu/renderer/st_menu_abstract_renderer.php'; 
	class st_menu_superfish_renderer extends st_menu_abstract_renderer {
		function __construct() {
			$_resources = array(
				'javascript' => array(
					'superfish/js/jquery-1.2.6.min.js',
					'superfish/js/hoverIntent.js',
					'superfish/js/superfish.js',
				),
				'css' => array(
					'superfish/css/superfish.css',
					'superfish/css/superfish-navbar.css',
				),
			);
			$this->setResources($_resources);
		}
		/**Lấy về nội dung sẽ được xuất ra*/
		public function getOutput() {
			// Thêm class
			$this->_menu->addClass('sf-menu');
			$this->_menu->addClass('sf-navbar');
			$_output = parent::getOutput();
			$_output .= $this->recursiveData($this->_menu);
			$_output .= $this->getActiveMenuScript();
			return $_output;
		}
		/**Sử dụng javascript để kích hoạt menu*/
		public function getActiveMenuScript() {
			@ob_start();
			require_once APP_JS_PATH . 'superfish/active.html';
			$_script = @ob_get_flush();
			return $_script;
		}
	}
?>